@extends('default.layouts.adminPublic')
@section('title', '企业试错列表')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
    @endsection
    @section('content')
            <!--导航开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="{{url('admin/links')}}">首页</a> &raquo; 企业试错列表
    </div>
    <!--导航结束-->
    <!--结果集标题与导航组件 开始-->
    <div class="con">
        <div class="conMain">
            <div class="result_wrap" style="height:140px;">
                <div class="search">
                    <form name="Formso" id="Formso" action="{{url('admin/company_trial')}}" method="post">
                        {{csrf_field()}}
                        <span>关键字：</span>
                        <span><input name="keyword" class="keyword" id="keyword" placeholder="请输入试错的用户名或IP"
                                     type="text"></span>
                        <span><input name="submit" class="skeyword" value="搜索" type="submit"></span>
                    </form>
                    <div class="smart">
                        <ul>
                            <li class="title">试错用户类型：</li>
                            <li><a style="color:#337ab7" href="{{url('admin/personal_trial')}}">个人试错记录</a></li>
                            <li><a style="color:#337ab7" href="{{url('admin/company_trial')}}">企业试错记录</a></li>
                        </ul>
                        <div class="message"><p>
                                目前共查找到<strong>{{$companyTrial->total()}}</strong>个记录！且每页显示企业试错记录{{$companyTrial->perPage()}}
                                个。</p></div>
                    </div>
                </div>
            </div>
            <div class="manage">
                @include('flash::message')
            </div>
            <div class="conInfo">
                <form name="thisForm" id="thisForm" action="" method="post">
                    {{csrf_field()}}
                    <div class="conList" id="conList">
                        <dl class="one">
                            <dt><input name="selectall" type="checkbox" value="1" onclick="CheckAll(this)"/></dt>
                            <dd class="trail1">用户名</dd>
                            <dd class="trail2">密码</dd>
                            <dd class="trail3">登录IP</dd>
                            <dd class="trail4">登录时间</dd>
                        </dl>
                        @if($companyTrial->count() > 0 )
                            @foreach($companyTrial as $v)
                                <dl id="list{{$v->id}}">
                                    <dt><input name="selected_id[]" type="checkbox" value="{{$v->id}}"/></dt>
                                    <dd class="trail1 sizeColor">{{str_limit($v->username,32)}}</dd>
                                    <dd class="trail2">{{str_limit($v->password,32)}}</dd>
                                    <dd class="trail3">{{$v->company_login_ip}}</dd>
                                    <dd class="trail4">{{$v->created_at}}</dd>
                                </dl>
                            @endforeach
                        @else
                            <div class="nullcon">对不起！没有企业试错记录！</div>
                        @endif
                        <dl class="last">
                            <dt>
                                <input name="selectall" id="selectall" type="checkbox" value="1"
                                       onclick="CheckAll(this)"/>
                                <label for="selectall">全选</label>
                            </dt>
                        </dl>
                    </div>
                </form>
                <div class="page_list" style="width: 100%; float: left; margin-top:15px;">
                    {!! $companyTrial->links() !!}
                </div>
            </div>

            <div class="stopper" style="margin-top:10px; border-top: 1px solid #e5e5e5"></div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
    @parent
    <script>
        var sign = true;
        //全选中与全不选中职位资料
        function CheckAll(form){
            if(form.checked == true){
                for(var i = 0; i < document.thisForm.elements.length; i++){
                    var e = document.thisForm.elements[i];
                    if(e.name == 'selectedid' || e.name == 'selected_id[]' || e.name == 'selectall')
                        e.checked = true;
                }
            }else{
                for(var i = 0; i < document.thisForm.elements.length; i++){
                    var e = document.thisForm.elements[i];
                    if(e.name == 'selectedid' || e.name == 'selected_id[]' || e.name == 'selectall')
                        e.checked = false;
                }
            }
        }
    </script>
@endsection